\hypertarget{group__do__statemachine}{\section{Digital Output State Machine}
\label{group__do__statemachine}\index{Digital Output State Machine@{Digital Output State Machine}}
}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__do__statemachine_ga88f6f2ae56f37cde9afdfcd93591e119}{D\-O\-\_\-\-State\-\_\-t} \{ \\*
\hyperlink{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119adcb9d080c1c9c327c8146eb5e691e6ee}{D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}, 
\hyperlink{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a8986f42023508bfe1fb3ed8a3ce57645}{D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}, 
\hyperlink{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4dde3b6c7080f7f723c3127b79e53e1e}{D\-O\-\_\-\-I\-D\-L\-E}, 
\hyperlink{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a3265a3094198820b0360abb5dd57508b}{D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G}, 
\\*
\hyperlink{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4165bc81d865b678b2f9b7410eed6018}{D\-O\-\_\-\-R\-E\-S\-E\-T}
 \}
\begin{DoxyCompactList}\small\item\em Digital output state machine state definitions. Defines all the possible states for the digital output state machine to be in. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__do__statemachine_gaa65e663980860e8c565c42c90b0fc520}{D\-O\-\_\-\-Machine\-\_\-\-Create} (void)
\begin{DoxyCompactList}\small\item\em Create the digital output state machine. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga989482cb42c01d19188c2551ac69abd2}{D\-O\-\_\-\-Machine\-\_\-\-Init} (void)
\begin{DoxyCompactList}\small\item\em Initialize the digital output state machine. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga9b716c10660b0b05539ac2223c533f93}{D\-O\-\_\-\-Machine\-\_\-\-Service} (void)
\begin{DoxyCompactList}\small\item\em Perform a periodic service of the state machine. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga9e56e4b7770bc82d5cd41fdd01bd4f7b}{D\-O\-\_\-\-Machine\-\_\-\-Halt} (void)
\begin{DoxyCompactList}\small\item\em Halt any current operations and return the idle state. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga343b1742c0f79f1aa637f718ba61f6d5}{D\-O\-\_\-\-Machine\-\_\-\-Idle} (void)
\begin{DoxyCompactList}\small\item\em Idle state handler. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga2314b594125edbaaac497a4466ac478a}{D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample} (\hyperlink{struct_digital___output__t}{Digital\-\_\-\-Output\-\_\-t} $\ast$$\ast$outputs, uint32\-\_\-t count, \hyperlink{group__data__types_ga0ecf26b576b9a54eca656b9be7ba6a06}{bool} single\-Channel)
\begin{DoxyCompactList}\small\item\em Output sampling state handler. \end{DoxyCompactList}\item 
void \hyperlink{group__do__statemachine_ga3279edae8dde5bd486d1cfdd131de75c}{D\-O\-\_\-\-Machine\-\_\-\-Reset} (void)
\begin{DoxyCompactList}\small\item\em Reset state handler. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}


\subsection{Enumeration Type Documentation}
\hypertarget{group__do__statemachine_ga88f6f2ae56f37cde9afdfcd93591e119}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-State\-\_\-t@{D\-O\-\_\-\-State\-\_\-t}}
\index{D\-O\-\_\-\-State\-\_\-t@{D\-O\-\_\-\-State\-\_\-t}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-State\-\_\-t}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf D\-O\-\_\-\-State\-\_\-t}}}\label{group__do__statemachine_ga88f6f2ae56f37cde9afdfcd93591e119}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D@{D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}!Digital Output State Machine@{Digital Output State Machine}}\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D@{D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}}\item[{\em 
\hypertarget{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119adcb9d080c1c9c327c8146eb5e691e6ee}{D\-O\-\_\-\-U\-N\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}\label{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119adcb9d080c1c9c327c8146eb5e691e6ee}
}]The state machine is in an invalid, uninitialized state. \index{D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D@{D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}!Digital Output State Machine@{Digital Output State Machine}}\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D@{D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}}\item[{\em 
\hypertarget{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a8986f42023508bfe1fb3ed8a3ce57645}{D\-O\-\_\-\-I\-N\-I\-T\-I\-A\-L\-I\-Z\-E\-D}\label{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a8986f42023508bfe1fb3ed8a3ce57645}
}]The state machine is in a valid, initialized state. \index{D\-O\-\_\-\-I\-D\-L\-E@{D\-O\-\_\-\-I\-D\-L\-E}!Digital Output State Machine@{Digital Output State Machine}}\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-I\-D\-L\-E@{D\-O\-\_\-\-I\-D\-L\-E}}\item[{\em 
\hypertarget{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4dde3b6c7080f7f723c3127b79e53e1e}{D\-O\-\_\-\-I\-D\-L\-E}\label{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4dde3b6c7080f7f723c3127b79e53e1e}
}]The state machine is idling. \index{D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G@{D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G}!Digital Output State Machine@{Digital Output State Machine}}\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G@{D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G}}\item[{\em 
\hypertarget{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a3265a3094198820b0360abb5dd57508b}{D\-O\-\_\-\-C\-H\-A\-N\-N\-E\-L\-\_\-\-S\-A\-M\-P\-L\-I\-N\-G}\label{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a3265a3094198820b0360abb5dd57508b}
}]The state machine is configured for sampling digital outputs. \index{D\-O\-\_\-\-R\-E\-S\-E\-T@{D\-O\-\_\-\-R\-E\-S\-E\-T}!Digital Output State Machine@{Digital Output State Machine}}\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-R\-E\-S\-E\-T@{D\-O\-\_\-\-R\-E\-S\-E\-T}}\item[{\em 
\hypertarget{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4165bc81d865b678b2f9b7410eed6018}{D\-O\-\_\-\-R\-E\-S\-E\-T}\label{group__do__statemachine_gga88f6f2ae56f37cde9afdfcd93591e119a4165bc81d865b678b2f9b7410eed6018}
}]The state machine is resetting. It will return to I\-D\-L\-E after reset completes. \end{description}
\end{Desc}


Definition at line 60 of file D\-O\-\_\-\-State\-Machine.\-h.



\subsection{Function Documentation}
\hypertarget{group__do__statemachine_gaa65e663980860e8c565c42c90b0fc520}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Create@{D\-O\-\_\-\-Machine\-\_\-\-Create}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Create@{D\-O\-\_\-\-Machine\-\_\-\-Create}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Create}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Create (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_gaa65e663980860e8c565c42c90b0fc520}
Creates the D\-O state machine. Note that no initialization is done here.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 96 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga9e56e4b7770bc82d5cd41fdd01bd4f7b}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Halt@{D\-O\-\_\-\-Machine\-\_\-\-Halt}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Halt@{D\-O\-\_\-\-Machine\-\_\-\-Halt}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Halt}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Halt (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga9e56e4b7770bc82d5cd41fdd01bd4f7b}
Halt the current sampling activity of the D\-O state machine and return to the idle state. This can be used to interrupt long term or continuous sampling.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 200 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga343b1742c0f79f1aa637f718ba61f6d5}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Idle@{D\-O\-\_\-\-Machine\-\_\-\-Idle}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Idle@{D\-O\-\_\-\-Machine\-\_\-\-Idle}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Idle}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Idle (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga343b1742c0f79f1aa637f718ba61f6d5}
Enter the idle state. In this state the D\-O will be made to do nothing.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 218 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga989482cb42c01d19188c2551ac69abd2}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Init@{D\-O\-\_\-\-Machine\-\_\-\-Init}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Init@{D\-O\-\_\-\-Machine\-\_\-\-Init}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Init}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga989482cb42c01d19188c2551ac69abd2}
Initializes the D\-O state machine to a valid state and performs all necessary setup of the D\-O.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 109 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga2314b594125edbaaac497a4466ac478a}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample@{D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample@{D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Output\-\_\-\-Sample (
\begin{DoxyParamCaption}
\item[{{\bf Digital\-\_\-\-Output\-\_\-t} $\ast$$\ast$}]{outputs, }
\item[{uint32\-\_\-t}]{count, }
\item[{{\bf bool}}]{single\-Channel}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga2314b594125edbaaac497a4466ac478a}
Enter the output sampling state. In this state the D\-O will be made to sample a set of outputs each the specified number of times.


\begin{DoxyParams}{Parameters}
{\em outputs} & Digital\-\_\-\-Output\-\_\-t$\ast$$\ast$ Pointer to array of output data structures holding the configurations of the sampling. \\
\hline
{\em count} & uint32\-\_\-t The number of samples of each output to take. 0 results in continuous sampling. \\
\hline
{\em single\-Channel} & bool True if the sampling is for a single channel only. \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 241 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga3279edae8dde5bd486d1cfdd131de75c}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Reset@{D\-O\-\_\-\-Machine\-\_\-\-Reset}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Reset@{D\-O\-\_\-\-Machine\-\_\-\-Reset}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Reset}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Reset (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga3279edae8dde5bd486d1cfdd131de75c}
Enter the reset state. In this state the D\-O will be reset and returned to the idle state.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 311 of file D\-O\-\_\-\-State\-Machine.\-c.

\hypertarget{group__do__statemachine_ga9b716c10660b0b05539ac2223c533f93}{\index{Digital Output State Machine@{Digital Output State Machine}!D\-O\-\_\-\-Machine\-\_\-\-Service@{D\-O\-\_\-\-Machine\-\_\-\-Service}}
\index{D\-O\-\_\-\-Machine\-\_\-\-Service@{D\-O\-\_\-\-Machine\-\_\-\-Service}!Digital Output State Machine@{Digital Output State Machine}}
\subsubsection[{D\-O\-\_\-\-Machine\-\_\-\-Service}]{\setlength{\rightskip}{0pt plus 5cm}void D\-O\-\_\-\-Machine\-\_\-\-Service (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__do__statemachine_ga9b716c10660b0b05539ac2223c533f93}
Perform a periodic service of the state machine. This will subsequently call the relevant state handler.


\begin{DoxyParams}{Parameters}
{\em none} & \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em none} & \\
\hline
\end{DoxyRetVals}


Definition at line 144 of file D\-O\-\_\-\-State\-Machine.\-c.

